﻿<!doctype html>
<html lang="zh" xmlns:th="http://www.thymeleaf.org" xmlns:layout="http://www.ultraq.net.nz/web/thymeleaf/layout" layout:decorate="~{theme/vCard/layout}">

<head>
	<title th:text="${#servletContext.getAttribute('configMap')['blog_name']} + ' | ' + ${post.title}"></title>
</head>
<body>
	<div layout:fragment="content">
		<div class="box box-content postContainer">
			<!-- Post -->
			<div class="pb-3">
				<header class="header-post">
					<h1 class="title title--h1" th:text="${post.title}"></h1>
					<hr>
					<div class="alert alert-danger" th:if="${post.reprint == true}">
						<ul class="post-copyright">
							<li>
								<strong>原作者:</strong> <b>[[${post.author}]]</b>
							</li>
							<li>
								<strong>原文链接:</strong> <a class="alert-link" th:href="@{${post.reprintLink}}" target="_blank" th:text="${post.reprintLink}"></a>
							</li>
						</ul>
					</div>
				</header>

				<div id="post-content" class="caption-post post-content" th:data-id="${post.id}" th:utext="${post.contentHtml}"></div>

				<div id="share" class="shareContainer">
					<div class="btns">
						<button type="button" class="btn btn-default" id="priseBtn" th:data-id="${post.id}"><i class="fa fa-thumbs-o-up"></i>&nbsp;<span id="prizeCount">[[${post.praiseNum}]]</span></button>
					</div>
				</div>

				<div class="post-tags">
					<div class="tags" th:if="${#strings.isEmpty(post.tags) == false}">
						<a th:href="@{'/tags/' + ${tag} + '/'}" rel="tag" th:each="tag,status : ${#strings.arraySplit(post.tags, ',')}"><i class="fa fa-tag"></i> [[${tag}]]</a>
					</div>
				</div>

				<footer class="footer-post">
					<div class="social-share" data-initialized="true">
						<a href="#" class="social-share-icon icon-weibo"></a>
						<a href="#" class="social-share-icon icon-qq"></a>
						<a href="#" class="social-share-icon icon-qzone"></a>
						<a href="#" class="social-share-icon icon-wechat"></a>
					</div>
				</footer>

				<div class="alert alert-primary" role="alert">
					<ul class="post-copyright">
						<li>
							<strong>本文作者:</strong> <b>[[${#servletContext.getAttribute('configMap')['blog_author']}]]</b>
						</li>
						<li>
							<strong>本文链接:</strong> <a id="shareUrl" class="alert-link" th:href="@{${#servletContext.getAttribute('configMap')['home_page']} + '/'+${post.link}}" target="_blank" th:text="${#servletContext.getAttribute('configMap')['home_page']+'/'+ post.link}"></a>
						</li>
						<li>
							<strong>版权声明:</strong>  本博客所有文章除特别声明外均为原创，采用 <a th:href="@{${#servletContext.getAttribute('configMap')['license_url']}}" class="alert-link" target="_blank" th:text="${#servletContext.getAttribute('configMap')['license']}"></a> 许可协议。转载请在文章开头明显位置注明原文链接和作者等相关信息，明确指出修改（如有），并通过 E-mail 等方式告知，谢谢合作！
						</li>
					</ul>
				</div>
			</div>
			
			<div class="post-other-info">
				<a th:href="${'/' + previousPost.link}" class="prev pull-left" th:if="${#objects.nullSafe(previousPost, null)}">上一篇<span class="hidden-xs">：《[[${previousPost.title}]]》</span></a>
				<a th:href="${'/' + nextPost.link}" class="next pull-right" th:if="${#objects.nullSafe(nextPost, null)}">下一篇<span class="hidden-xs">：《[[${nextPost.title}]]》</span></a>
			</div>

			<!-- 评论 -->
			<script type="text/javascript" th:inline="javascript">
				window.canComment = [[${post.comment}]];
			</script>
			<div th:replace="~{theme/vCard/common :: comment}"></div>

		</div>
		[(${#servletContext.getAttribute('configMap')['script_code']})]
	</div>
</body>
</html>